data_ind<-read.table("input_withcorrecthead.ind",sep="\t")
data<-read.table("input_withcorrecthead.tped",sep="\t",head=T)
dim(data)
colnames(data)[1:5]
dim(data)
data<-read.table("input_withcorrecthead.tped",sep=" ",head=T)
dim(data)
colnames(data)[1:5]
colnames(data_ind)
dim(data_ind)
data_ind[1,]
data<-data[,c(2,4:ncol(data))]
colnames(data)[1:5]
data<-data[,c(1,3:ncol(data))]
colnames(data)[1:5]
colnames(data_ind)<-c("rsid","isimputed","source","r2")
data<-merge(data_ind,data,by="rsid")
dim(data)
colnames(data)[1:7]
data_ind<-c()
hist<-hist(data[,5],breaks=seq(0,39,0.01),plot=FALSE)
attributes(hist)
hist$count[1:5]
hist<-hist(data[,5],breaks=seq(0,2,0.1),plot=FALSE)
hist$count[1:5]
table(data[,3])
colnames<-colnames(data)
AFFY<-data[which(data[,3]=="AFFY"),]
dim(AFFY)
HAPMAP<-data[which(data[,3]=="HAPMAP"),]
HAPMAP<-c()
AFFY<-c()
i<-5
AFFY<-c()
while(i<ncol(data)+1)
{
hist<-hist(data[which(data[,3]=="AFFY"),i],breaks=seq(0,2,0.1),plot=FALSE)
AFFY<-rbind(AFFY,hist$counts)
i<-i+1
}
dim(AFFY)
rownames(AFFY)<-colnames(data)[5:ncol(data)]
colnames(AFFY)<-seq(0,2,0.1)
write.table(AFFY,"AFFY_DOSAGE_COUNTS.txt",sep="\t",quote=FALSE,row.names=TRUE,col.names=FALSE)
i<-5
ILL550V3<-c()
while(i<ncol(data)+1)
{
hist<-hist(data[which(data[,3]=="ILL550V3"),i],breaks=seq(0,2,0.1),plot=FALSE)
ILL550V3<-rbind(ILL550V3,hist$counts)
i<-i+1
}
rownames(ILL550V3)<-colnames(data)[5:ncol(data)]
write.table(ILL550V3,"ILL550V3_DOSAGE_COUNTS.txt",sep="\t",quote=FALSE,row.names=TRUE,col.names=FALSE)
getwd()
savehistory("individualcounts_affy_illumina.R")
